subdomain creation by htaccess

Discussion in 'Apache' started by isnain, Aug 12, 2008.

  1. #1
    isnain, Aug 12, 2008 IP
  2. Property_Control

    Property_Control Peon

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you're trying to redirect, you can use PHP
    <?PHP
    header("Location: http://mydomain.com/publisher.php?pb=someone");
    ?>
    Set that page as 404 and it should work
     
    Property_Control, Aug 12, 2008 IP
  3. Estevan

    Estevan Peon

    Messages:
    120
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    0
    #3
    hello

    first need enable wild card dns

    add this entrie in domain.com.db in /var/named

    * IN CNAME @

    after this add entrie in httpd.conf
    under your virtual host
    ServerAlias *.domainname.com

    now the server answer all subdomains request and use the htaccess to redirect

    Best
     
    Estevan, Aug 12, 2008 IP